import { stringify } from 'qs';
import request from '../../common/utils/request';
import { Constants } from '../../common/constant/constants';

//菜单管理
export async function getMenu() {
    return request(Constants.JAVA_URL+'/sys/menu/nav');
}
export async function getMenuTree() {
    return request(Constants.JAVA_URL+'/sys/menu/tree');
}
export async function updateMenu(params) {
    return request(Constants.JAVA_URL+'/sys/menu/update', {
        method: 'POST',
        body: params,
    });
}
export async function saveMenu(params) {
    return request(Constants.JAVA_URL+'/sys/menu/save', {
        method: 'POST',
        body: params,
    });
}
export async function deleteMenu(params) {
    return request(Constants.JAVA_URL+`/sys/menu/delete?${stringify(params)}`,{
        method: 'DELETE',
    });
}